<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="采购价格维护" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addPlan()" ng-disabled="!btnPermission.purchasePriceMaintenanceAdd" title="{{!btnPermission.purchasePriceMaintenanceAdd?'无权限执行此操作':''}}">新增</button>
                    <button class="btn btn-operate m-r-sm" ng-click="importPrice()" ng-disabled="!btnPermission.purchasePriceMaintenanceImport">批量导入</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="供货商名称"
                               ng-model="condition.supplierName">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">零件编号：</label>
                        <input type="text" ng-model="condition.materialsNo" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">供货商名称：</label>
                        <input type="text" ng-model="condition.supplierName" class="form-control">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allCheckedBill" yb-click="selectAll(dataList, 'Bill')"></div>
                                </th>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.billFixedWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}" ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <div class="font-0">
                                        <button type="button" class="btn btn-operate m-r-xs" ng-click="editPlan(item)"
                                                ng-disabled="item.auditStatus === 1 || !btnPermission.purchasePriceMaintenanceEdit" title="{{!btnPermission.purchasePriceMaintenanceEdit?'无权限执行此操作':''}}">编辑</button>
                                        <button type="button" class="btn btn-operate m-r-xs" ng-click="delData('single', item.id)"
                                                ng-disabled="item.auditStatus === 1 || !btnPermission.purchasePriceMaintenanceDel" title="{{!btnPermission.purchasePriceMaintenanceDel?'无权限执行此操作':''}}">删除</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allCheckedBill" yb-check-name="全选"
                     yb-click="selectAll(dataList, 'Bill')"></div>
                <button class="btn btn-operate" ng-click="delData('batch')" ng-disabled="!btnPermission.purchasePriceMaintenanceDel"
                    title="{{!btnPermission.purchasePriceMaintenanceDel?'无权限执行此操作':''}}">删除</button>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="新增采购计划" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="row wrapper-y-sm">
                <div materiel-selector show-toolbar="toolbarConfig.showMateriel" is-purchase="true"
                 selected-list="orderObj.materialsList" replace-check="true"></div>
                <form class="p-t-sm p-b-sm form-horizontal form-up-tb clearfix" style="clear: both;padding-left: 20px;" novalidate>
                    <div class="form-group col-xs-2 m-b-sm" style="width: 100px;">
                        <button class="btn btn-operate m-r-sm" style="margin-top: 6px;text-align: right;" ng-click="selMateriel($event)">选择零件</button>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100">零件编号：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.materialsList[0].materialsNo}}">
                            {{orderObj.materialsList[0].materialsNo || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100">零件中文名：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.materialsList[0].materialsDes}}">
                            {{orderObj.materialsList[0].materialsDes || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100">单位：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.materialsList[0].unit}}">
                            {{orderObj.materialsList[0].unit || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-100">零件分类：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObj.materialsList[0].materialsType}}">
                            {{orderObj.materialsList[0].materialsType || "-"}}
                        </label>
                    </div>

                    <div class="form-group col-xs-2 m-b-sm" style="width: 100px; clear: both;">
                        <button class="btn btn-operate m-r-sm" style="margin-top: 6px;text-align: right;" ng-click="selectDealer()">选择供货商</button>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-120">供货商代码：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{supplierObj.supplierCode}}">
                            {{supplierObj.supplierCode || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-120">供货商名称：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{supplierObj.supplierOrgName}}">
                            {{supplierObj.supplierOrgName || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-120">供货商orgId：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{supplierObj.supplierOrgId}}">
                            {{supplierObj.supplierOrgId || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-120">供货商分类：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{supplierObj.supplierClassName}}">
                            {{supplierObj.supplierClassName || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-2 m-b-sm">
                        <label class="col-xs-4 control-label max-w-120">分类代码：</label>
                        <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{supplierObj.supplierClassId}}">
                            {{supplierObj.supplierClassId || "-"}}
                        </label>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" style="clear: both;margin-top: 20px;">
                        <label class="col-xs-3 control-label max-w-120"><i>*</i>采购单价：</label>
                        <div class="col-xs-7 wrapper-none">
                            <input yb-number-input max="9999999.99" maxlength="10" disable-decimal="false" decimal-places="2"
                                class="form-control" placeholder="请输入" maxlength="100" ng-model="orderObj.purchasePrice">
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" style="margin-top: 20px;">
                        <label class="col-xs-4 control-label max-w-120">是否暂估价：</label>
                        <div class="col-xs-8 control-label">
                            <input type="radio" class="m-r-sm pull-left" yb-radio ng-model="orderObj.provisionalPrice" value="0" yb-radio-name="否">
                            <input type="radio" class="m-r-sm pull-left" yb-radio ng-model="orderObj.provisionalPrice" value="1" yb-radio-name="是">
                        </div>
                    </div>
                </form>
                
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData()">保存</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>
        <div tab heading="编辑采购计划" active="activeFlag[2]" ng-if="activeFlag[2]">
            <form class="p-t-sm p-b-sm form-horizontal form-up-tb clearfix" style="clear: both;padding-left: 20px;" novalidate>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件编号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsNo}}">
                        {{orderObjShow.materialsNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件中文名：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsDes}}">
                        {{orderObjShow.materialsDes || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">单位：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.unit}}">
                        {{orderObjShow.unit || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件分类：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsType}}">
                        {{orderObjShow.materialsType || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm"style="clear: both;" >
                    <label class="col-xs-4 control-label max-w-120">供货商代码：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierCode}}">
                        {{orderObjShow.supplierCode || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商名称：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierName}}">
                        {{orderObjShow.supplierName || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商orgId：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierOrgId}}">
                        {{orderObjShow.supplierOrgId || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商分类：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.className}}">
                        {{orderObjShow.className || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-3 m-b-sm" style="clear: both;margin-top: 20px;">
                    <label class="col-xs-3 control-label max-w-120"><i>*</i>采购单价：</label>
                    <div class="col-xs-7 wrapper-none">
                        <input yb-number-input max="9999999.99" maxlength="10" disable-decimal="false" decimal-places="2"
                            class="form-control" placeholder="请输入" ng-model="orderObjShow.price">
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm" style="margin-top: 20px;">
                    <label class="col-xs-4 control-label max-w-120">是否暂估价：</label>
                    <div class="col-xs-8 control-label">
                        <input type="radio" class="m-r-sm pull-left" yb-radio ng-model="orderObjShow.provisionalPrice" value="0" yb-radio-name="否">
                        <input type="radio" class="m-r-sm pull-left" yb-radio ng-model="orderObjShow.provisionalPrice" value="1" yb-radio-name="是">
                    </div>
                </div>
            </form>
            <div class="bottom-area btn-bar text-center border-t clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveDataEditor()">保存</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[3]" ng-if="activeFlag[3]">
            <form name="form" class="p-t-sm p-b-sm form-horizontal form-up-tb clearfix" style="clear: both;padding-left: 20px;" novalidate>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件编号：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsNo}}">
                        {{orderObjShow.materialsNo || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件中文名：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsDes}}">
                        {{orderObjShow.materialsDes || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">单位：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.unit}}">
                        {{orderObjShow.unit || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100">零件分类：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.materialsType}}">
                        {{orderObjShow.materialsType || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm"style="clear: both;" >
                    <label class="col-xs-4 control-label max-w-120">供货商代码：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierCode}}">
                        {{orderObjShow.supplierCode || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商名称：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierName}}">
                        {{orderObjShow.supplierName || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商orgId：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierOrgId}}">
                        {{orderObjShow.supplierOrgId || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">供货商分类：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.className}}">
                        {{orderObjShow.className || "-"}}
                    </label>
                </div>
                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">分类代码：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.supplierClassId}}">
                        {{orderObjShow.supplierClassId || "-"}}
                    </label>
                </div>
                
                <div class="form-group col-xs-2 m-b-sm" style="clear: both;">
                    <label class="col-xs-4 control-label max-w-120">采购单价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.price}}">
                        {{orderObjShow.price || "-"}}
                    </label>
                </div>

                <div class="form-group col-xs-2 m-b-sm">
                    <label class="col-xs-4 control-label max-w-120">是否暂估价：</label>
                    <label class="col-xs-8 control-label p-l-n text-left spill-dots" title="{{orderObjShow.provisionalPrice}}">
                        {{orderObjShow.provisionalPrice | TrueOrFalse}}
                    </label>
                </div>
            </form>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">返回</button>
            </div>
        </div>
    </div>
</div>